require 'logger'
require 'scanner/scanner'
require 'parser/parser'

log = Logger.new(STDERR)
log.datetime_format = ""
log.progname = "Main"
log.level = Logger::WARN

scanner = Scanner.new(STDIN)
parser = Parser.new(scanner)

log.info {"** Looking for a program **"}
begin
  parse_tree = parser.program()
rescue Exception => e
  log.error {"Error on line #{scanner.line_num}:\n#{$!}"}
end
log.debug parse_tree

log.close